const db = require('../db/index.js')
const bcrypt = require('bcryptjs')

exports.getUserInfo = (req, res) =>{

	console.log(req.params.author_id)
	
	const sql = `select id,nickname,email,user_pic from ev_users where id=?`
	db.query(sql, req.params.author_id, (err, results)=>{
		if(err)
			return err
	
		if(results.length !== 1)
			return res.cc('获取用户信息失败!')
	
		res.send({
			status: 0,
			message: '获取用户信息成功',
			body: results[0]
		}) 
	})
	
}